package day9;

/**
 * @author oldliu
 * @since 1.0
 */
public class Car  extends Vechile {
    private String type;
    public Car(){

    }
    public Car(String licensePlate, String brand, double dailyRent, String type) {
        super(licensePlate, brand, dailyRent);
        this.type=type;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public void show() {
        System.out.print("轿车：车牌 "+this.getLicensePlate()+",品牌："+this.getBrand()+",车型："+type+",日租金：￥"+this.getDailyRent()+"元,当前"+(super.isState()?"可租":"已出租") +"  ");
        System.out.println();
    }

    @Override
    public double calcMoney(int days) {
        double m=this.getDailyRent()*days;
        if(days>150)
            m*=0.7;
        else if(days>30)
            m*=0.8;
        else if(days>7)
            m*=0.9;
        return m;
    }
}
